﻿@using Abp.Application.Services.Dto;
@using FwProject.Distribution.Dto.Statistics
@model List<QuarterlySummaryMonthDto>
@{
    ViewBag.Title = "当季汇总-详情";
    DateTime? time = ViewBag.Time as DateTime?;
}
@section styles{
    <link href="~/Theme/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="~/Theme/css/plugins/datapicker/datepicker3.css" rel="stylesheet">
    <style type="text/css">
        .input-group[class*=col-] {
            padding: 0 15px;
        }

        .fl {
            float: left;
        }
    </style>
}
<div class="row wrapper wrapper-content animated fadeInRight">
    <div class="col-sm-12">
        <div class="ibox float-e-margins">
            <div class="ibox-title">
                <h5>@ViewBag.Title</h5>
                <div class="ibox-tools">
                    <a class="collapse-link">
                        <i class="fa fa-chevron-up"></i>
                    </a>
                    <a class="dropdown-toggle" data-toggle="dropdown" href="buttons.html#">
                        <i class="fa fa-wrench"></i>
                    </a>
                    <ul class="dropdown-menu dropdown-user">
                        <li>
                            <a href="javascript:Print()">打印</a>
                        </li>
                        <li>
                            <a href="buttons.html#">导出</a>
                        </li>
                    </ul>
                    @*<a class="close-link">
                            <i class="fa fa-times"></i>
                        </a>*@
                </div>
            </div>
            <div class="ibox-content">
                <div class="row m-b-sm m-t-sm">
                    <form class="form-horizontal" asp-controller="DistributionReport" asp-action="QuarterlyDetailsM" data-ajax="true" data-ajax-update="#data_list" data-ajax-method="Get" data-ajax-mode="replace" data-ajax-begin="AjaxBegin" data-ajax-success="AjaxSuccessCallback">
                        <div class="row m-b-sm">
                            <div class="col-lg-4">
                                <label class="fl control-label" style="width: 70px;">选择月份：</label>
                                <div class="input-group date">
                                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                    <span style="position: relative;">
                                        <input type="text" name="time" id="" class="form-control" value="@(time.HasValue?time.Value.ToString("yyyy-MM"):"")" />
                                    </span>
                                    <span class="input-group-btn">
                                        <button type="submit" class="btn btn-sm btn-primary" style="padding:7px 12px"> 搜索</button>
                                    </span>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
                <div id="data_list">
                    @{Html.RenderPartial("QuarterlyDetailsMPartial", Model);}
                </div>
            </div>
        </div>
    </div>
</div>
<div id="modal_ajax" class="modal inmodal fade" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
</div>

@section scripts{
    <script src="~/Theme/js/content.min.js?v=1.0.0"></script>
    <script src="~/Theme/js/plugins/iCheck/icheck.min.js"></script>
    <script src="~/Theme/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="~/Theme/js/plugins/suggest/bootstrap-suggest2014.js"></script>
    <script src="~/js/PrintUtil.js"></script>
    <script type="text/javascript">
           function Print() {
            printGirdObj({
                containerId: 'table_print',//包含表格容器のID
                title: '@ViewBag.Title',
                showRowNum: false,  //表格中rownumbers: true时为true
                showOrder: false,//是否显示序号，rownumbers: true时有效，默认false
                printInit: { //打印初始化设置参数
                    portrait: false //true纵向,false横向
                }
            });
        }
        //layer.msg("test",{time:2000});
        $(document).ready(function () {
            $(".date input").datepicker({
                todayBtn: "linked", keyboardNavigation: !1, forceParse: !1, calendarWeeks: !0, autoclose: !0,
                format: 'yyyy-mm',
                startView: 'months', //开始视图层，为月视图层
                maxViewMode: 'years', //最大视图层，为年视图层
                minViewMode: 'months', //最小视图层，为月视图层
            });
            $('#modal_ajax').on('show.bs.modal', function (e) {
                $(this).addClass('loading');
                var $button = $(e.relatedTarget);
                var url = $button.data('url');
                if (!!url) {
                    url = url + ((url.indexOf("?") > -1) ? "&r=" : "?r=") + Math.random();
                    $(this).load(url, function () {
                        $.validator.unobtrusive.parse(this); //$("#form_model_create").validate();
                        $("input[name='Member.Birthday']").datepicker({ todayBtn: "linked", keyboardNavigation: !1, forceParse: !1, calendarWeeks: !0, autoclose: !0 });
                        $(".i-checks").iCheck({ checkboxClass: "icheckbox_square-green", radioClass: "iradio_square-green", });
                        $(this).removeClass('loading');
                    });
                }
            });
            $('#modal_ajax').on('hidden.bs.modal', function (e) {
                $(this).empty();
            });

            $('#modal_del,#modal_password_reset').on('show.bs.modal', function (e) {
                var $button = $(e.relatedTarget);
                var url = $button.data('url');
                if (!!url)
                    url = url + ((url.indexOf("?") > -1) ? "&r=" : "?r=") + Math.random();
                $(this).find("form").attr("action", url);
            });
            $('#modal_del,#modal_password_reset').on('hidden.bs.modal', function (e) {
                $(this).find("form").attr("action", "");
            });
        });



        function ReloadAjaxCallbackgoback(data, successInfo) {
            CommonAjaxCallback(data, function () {
                $('#modal_ajax').modal("hide");
                window.location.reload();
            }, successInfo);
        }

    </script>
}
